<template>
  <div class="recharge-confirm">
    <div class="recharge-confirm-top">
      <p class>充值结果</p>
      <span @click="done">完成</span>
    </div>
    <div class="recharge-confirm-flow">
      <div class="recharge-flow-item active">
        <i></i>
        <div class="recharge-flow-tips">
          <p class="recharge-flow-tips-title">提交申请，等待审核</p>
          <p class="recharge-flow-tips-cont">充值金额：{{form.amount}}{{form.currency_code}}</p>
        </div>
      </div>
      <div class="recharge-flow-item">
        <i></i>
        <div class="recharge-flow-tips">
          <p class="recharge-flow-tips-title">客服受理</p>
          <p class="recharge-flow-tips-cont"></p>
        </div>
      </div>
      <div class="recharge-flow-item">
        <i></i>
        <div class="recharge-flow-tips">
          <p class="recharge-flow-tips-title">财务受理</p>
          <p class="recharge-flow-tips-cont"></p>
        </div>
      </div>
      <div class="recharge-flow-item">
        <i></i>
        <div class="recharge-flow-tips">
          <p class="recharge-flow-tips-title">充值完成</p>
          <p class="recharge-flow-tips-cont"></p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  validate({store,redirect}){
    // 如果form为空，表示没有经过上一步操作非法进入页面
    if(!store.state.draw.form || !store.state.draw.form.amount){
      redirect('/wealth/draw');
    }
    return true;
  },
  asyncData({store,app}){
    let form = JSON.parse(JSON.stringify(store.state.draw.form));
    return {
      form,
    }
  },
  data: function() {
    return {};
  },
  destroyed(){ // 离开页面后销毁转账流程数据
    //清除转账流程状态
    this.$store.dispatch('draw/clear');
  },
  methods:{
    done(){
      this.$router.replace('/wealth')
    }
  }
};
</script>

<style lang="less" scoped>
.recharge-confirm {
  overflow: hidden;
  color: rgb(41, 41, 41);
}
.recharge-confirm-top {
  height: 88px;
  font-family: "PingFangSC-Medium";
  font-size: 36px;
  background-color: #fff;
}
.recharge-confirm-top i {
  margin-left: 30px;
  margin-top: 25px;
  position: absolute;
  width: 21px;
  height: 38px;
  background: url("~assets/img/black_blue@2x.png") no-repeat;
  background-size: 21px 38px;
  z-index: 10;
}
.recharge-confirm-top p {
  position: absolute;
  width: 100%;
  line-height: 88px;
  text-align: center;
}
.recharge-confirm-top span {
  position: absolute;
  right: 30px;
  line-height: 88px;
  font-family: "PingFangSC-Regular";
  font-size: 30px;
  color: #2086f9;
}
.recharge-confirm-flow {
  padding-top: 50px;
  height: 620px;
  font-family: "PingFangSC-Regular";
  font-size: 32px;
  background-color: #fff;
}
.recharge-flow-item i {
  position: absolute;
  width: 40px;
  height: 40px;
  background: url("~assets/img/fuxuankuang_unsel@2x.png") no-repeat;
  background-size: 40px 40px;
}
.recharge-flow-item.active i {
  background: url("~assets/img/fuxuankuang_sel@2x.png") no-repeat;
  background-size: 40px 40px;
}
.recharge-flow-tips {
  margin-left: 60px;
  padding-top: 5px;
}
.recharge-flow-tips-title {
  /* color: #d39b00; */
}
.recharge-flow-item.active .recharge-flow-tips-title {
  color: #d39b00;
}
.recharge-flow-tips-cont {
  padding-top: 22px;
  font-family: "PingFangSC-Medium";
  font-size: 28px;
  color: #666666;
}
.recharge-flow-item {
  position: relative;
  height: 155px;
  margin-left: 50px;
  &:last-child {
    &::before {
      display: none;
    }
  }
  &.active {
    &::after {
      content: '';
      position: absolute;
      top:30px;
      left:18px;
      width:4px;
      height:50%;
      background-color: rgb(211,155,0);
    }
  }
  &::before {
    content:'';
    position:absolute;
    top:30px;
    left:18px;
    width:4px;
    height: 100%;
    background-color:rgb(191,195,205);
  }
}
</style>
